(function($){ $.fn.validationEngineLanguage = function(){ }; $.validationEngineLanguage = { newLang: function(){ $.validationEngineLanguage.allRules = { "required": { // Add your regex rules here, you can take telephone as an example "regex": "none", "alertText": "Trường này bắt buộc", "alertTextCheckboxMultiple": "Vui lòng chọn dữ liệu tại ô có dấu *", "alertTextCheckboxe": "Vui lòng lựa chọn ô có dấu *", "alertSelectText": "Vui lòng lựa chọn một giá trị" }, "minSize": { "regex": "none", "alertText": "* Tối thiểu ", "alertText2": " ký tự" }, "equalsSize": { "regex": "none", "alertText": "* Bắt buộc ", "alertText2": " ký tự" }, "maxSize": { "regex": "none", "alertText": "* Tối đa ", "alertText2": " ký tự" }, "min": { "regex": "none", "alertText": "Giá trị tối thiểu là " }, "max": { "regex": "none", "alertText": "Giá trị tối đa là " }, "past": { "regex": "none", "alertText": "Phải trước ngày " }, "expiredDate": { "regex": "none", "alertText": "Ngày hết hạn phải sau ngày " }, "future": { "regex": "none", "alertText": "Phải sau ngày ", "alertText2": "hôm nay" }, "maxCheckbox": { "regex": "none", "alertText": "Kiểm tra hạn mức cho phép !" }, "minCheckbox": { "regex": "none", "alertText": "Vui lòng chọn ", "alertText2": " nội dung !" }, "equals": { "regex": "none", "alertText": "Nội dung không khớp!" }, "passwordnew": { "regex": "none", "alertText": "Mật khẫu mới không được giống mật khẩu cũ" }, "phone": { // credit: jquery.h5validate.js / orefalo "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/, "alertText": "* Số điện thoại không hợp lệ !" }, "email": { // Simplified, was not working in the Iphone browser "regex": /^([A-Za-z0-9_\-\.\'])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,6})$/, "alertText": "* Địa chỉ email không hợp lệ !" }, "integer": { "regex": /^[\-\+]?\d+$/, "alertText": "* Số đã nhập không hợp lệ !" }, "number": { // Number, including positive, negative, and floating decimal. credit: orefalo "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/, "alertText": "* Số thập phân không hợp lệ !" }, "date": { "regex": /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/, "alertText": "Vui lòng nhập theo định dạng DD/MM/YYYY" }, "ipv4": { "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/, "alertText": "* Địa chỉ IP không hợp lệ !" }, "url": { "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/, "alertText": "* URL không hợp lệ !" }, "s": { "regex": /^[0-9\ ]+$/, "alertText": "* Vui lòng chỉ nhập số !" }, "beginOneNo":{ "regex": /^1[0-9]{7}$/, "alertText": "*Số hợp đồng gồm 8 ký tự số, bắt đầu bằng số 1!" } , "onlyLetterSp": { "regex": /^[a-zA-Z\ \']+$/, "alertText": "* Vui lòng chỉ nhập chữ !" }, "onlyLetterNumber": { "regex": /^[0-9a-zA-Z]+$/, "alertText": "* Vui lòng không nhập các ký tự đặc biệt !" }, "password": { "regex": /^[0-9a-zA-Z!@#?$%^&]+$/, "alertText": "Mật khẩu có chứa kí tự đặc biệt" }, "freqMax": { "alertText":"* Tần suất cho phép là ngày nhỏ hơn 30 và tháng nhỏ hơn 12" }, "futureDate":{ "alertText":"* Ngày bắt đầu phải sau ngày hiện tại" }, "startDate":{ "alertText":"* Ngày bắt đầu trước ngày kết thúc" }, "onlyAmount": { // Number, including positive, negative, and floating decimal. credit: orefalo "regex": /^([0-9\,])+$/, "alertText": "Số tiền chỉ chứa số 0-9 và dấu ," }, "ajaxUserCall": { "url": "ajaxValidateFieldUser", // you may want to pass extra data on the ajax call "extraData": "name=eric", "alertText": "Tên này được dùng", "alertTextLoad": "Đang xác nhận, vui lòng chờ" }, // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings }; } }; $.validationEngineLanguage.newLang(); })(jQuery);